<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >

<head>
   <%@ include file="/common/CimsCommon.jsp" %>
   <title>新增合作机构交易流水表</title>
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<link rel="stylesheet" href="<%=basePath%>/css/cims/cmmBase.css">
	<script type="text/javascript" src="<%=basePath%>/js/cims/creditManage/contractMassage.js"></script>
	<script type="text/javascript" src="${basePath}/js/cims/publicJs/modelManage.js"></script>
	<script type="text/javascript">
	var urlTatile = "${basePath}";
		$(document).ready(function(){
		Cmm.util.dateInputInit("dealDate");
			var cooperorgCode = $('#dtocooperorgCode').val();
			
			if(cooperorgCode!="XS"&&cooperorgCode!="XQ"){
				$("#finishDeal").hide();
			}
			
			
			var contractCode = $('#dtocontractCode').val();
			var dealType = $("#cooperativeAgencyDealStatus").val();
			if(dealType=='02'||dealType=='03'){
				$("#addCredit").hide();
				$("#deleteCredit").hide();
				$("#saveDeal").hide();
				$("#isDeleteAndIsExport").val("true");
				$("#statementDateStart").attr("disabled","disabled");
				$("#statementDateEnd").attr("disabled","disabled");
				$("#publicRepayType").attr("disabled","disabled");
			}else{
				$("#isDelete").val("true");
				$("#statementDateStart").attr("disabled","disabled");
				$("#statementDateEnd").attr("disabled","disabled");
				$("#publicRepayType").attr("disabled","disabled");
				
			}
			
			if(dealType=='03'){
				//$("#finishDeal").hide();
			}
			
			$("#operation").attr("disabled","disabled");
			initFnCreditDetailView();				
			searchCreditPackage("creditPackage","${packageDto.creditPackageName}","update");
			//costParameters("costParameter","${dealDto.creditPackageName}","update1");
			costParameters("costParameter");
			costParameters("costParameter2");
			CreditValueSum();
			//月还归属
			var v = "${affiliationValue}";
			if(v!=""&&v!=null){
				$("#creditAffiliation").attr("disabled","disabled");
			}
	
		});
	</script>
	
</head>
  
<body style="background-color:#FFFFFF;">
<div id="formPageSwap">
  <br/>
<form id="addNewsFormData" name="addNewsFormData" isCheck="true" action="com.jy.modules.cims.creditDeal.controller.TCMmCooperorgDealController">
 <table id="addNewsTableId" class="formTableSwap" style="background:#D9D8DF;" border="0" align="center" cellpadding="0" cellspacing="1" >
<tr>
<td colspan="6" align="center" class="thTop">合约信息 <!-- <span id="spanCode"><a class="aColor" href="javascript:void(0)" onclick="toAddContract()" >导入合约</a></span> --></td>
</tr>
<tr>
  <th> 合作机构 ：</th>
  <td >
  <input type="text" style="display:none;" id="exportType" value="credit">
  <input type="text" style="display:none;" id="isDelete" value="false">
  <input type="text" style="display:none;" id="isDeleteAndIsExport" value="false">
  <input type="text" style="display:none;" name="isSelectContract" id="isSelectContract" value="true">
  <input type="text" style="display:none;" name="idValue" id="idValue" value="${idDeal}">
  <input type="text" style="display:none;" name="dealCode" id="dealCode" value="${dealCode}" >
  <input type="text" style="display:none;" name="dealDate" id="dealDate" value="${dealDto.dealDate}" >
  <input type="text" style="display:none;" name="cooperativeAgencyDealStatus" id="cooperativeAgencyDealStatus" value="${dealDto.cooperativeAgencyDealStatus}" >
  <input type="text" style="display:none;" name="fileName" id="fileName" value="债权转让">
  <input type="text" style="display:none;" name="dealTypes" id="dealTypes" value="'01'">
  <input disabled="disabled" style="display:none;" type="text" class="text" id="dtocooperorgCode" name="cooperorgCode"   value="${dealDto.cooperorgCode}" />
  <input disabled="disabled" type="text" class="text" id="dtocooperorgName" name="cooperorgName"   value="${dealDto.cooperorgName}" />
  </td>
  <th> 协议名称 ：</th>
  <td >
  <input disabled="disabled" style="display:none;" type="text" class="text" id="dtoagreementCode" name="agreementCode"   value="${dto.agreementDTO.agreementCode}" /> 
  <input disabled="disabled" type="text" class="text" id="dtoagreementName" name="agreementName"   value="${dto.agreementDTO.agreementName}" />
  </td>
  <th> 合约名称 ：</th>
  <td >
  <input disabled="disabled" style="display:none;" type="text" class="text" id="productType" name="productType"   value="${dto.cdto.productType}" /> 
  <input disabled="disabled" style="display:none;" type="text" class="text" id="dtocontractCode" name="contractCode"   value="${dealDto.contractCode}" />
  <input disabled="disabled" type="text" class="text" id="dtocontractName" name="contractName"   value="${dealDto.contractName}" />
  </td>
</tr>

<tr>
<th style="display:none;"> 交易类型 ：</th>
  <td style="display:none;">
	<syscode:dictionary name="dealType" extendProperty="notNull=false" codeType="CREDIT_DEAL_TYPE" id="dealType"	
      defaultValue="${dealDto.dealType}" className="text" type="select"/>
  </td>
  
   <th> 价格认定方：</th>
  <td colspan="6"> 
   <syscode:dictionary name="creditorAffirmRule" extendProperty="notNull=false" codeType="creditConfirm" id="creditorAffirmRule"	
      defaultValue="${dto.cdto.creditorAffirmRule}" className="text" type="select"/>
  </td> 
  
   <!-- <th> 申请额度：</th>
   <td>
  	  <input type="text" class="text" id="dtoquotaSum" name="quotaSum"  maxLength="10" value="" >
  </td> -->
  
</tr>
<%-- <tr id="creditRestrainTitle">
<td colspan="6" align="center" class="thTop">债权约束</td>
</tr>

<tr id="creditRestrainTitleValue">
	<td colspan="6">
		<%@include file="../limitRequest/contractConstraint.jsp" %>
	</td>
</tr> --%>

<tr id="creditOperation">
 	<td colspan="6" align="center" class="thTop">债权操作</td>	
</tr>

<tr id="creditPackageColumn">
   <th> 选择债权包：</th>
   <td >
  	  <select id="creditPackage" onchange="creditPackageOperation(this)"></select>
  	  
  </td>
 <%--  <td>
  	<input id="creditPackageWrite"  style="display:none;"  type="text" value="${dealDto.creditPackageName}">
  </td> --%>
  <th> 账单日(始)：</th>
   <td>
   	<input type="text" class="text"  id="statementDateStart" name="statementDateStart"  value="${packageDto.billDate}">
  </td>
  <th> 账单日(止)：</th>
   <td>
   	<input type="text" class="text"  id="statementDateEnd" name="statementDateEnd"  value="${packageDto.billDateEnd}">
  </td>
  
</tr>

<tr>
<th> 还款方式：</th>
  <td> 
<syscode:dictionary name="publicRepayType" extendProperty="notNull=false" codeType="CM_REPAYMENTWAY" id="publicRepayType"	
      defaultValue="${packageDto.repayType}" className="text" type="select"/>
     </td>
     
  <th> 费用参数：</th> 
  <td >
  	  <select id="costParameter" >
  	    
  </td>  
  <th> 月还归属：</th> 
  <td >
  	  <syscode:dictionary name="creditAffiliation" codeType="REPAYAFFILIATION" id="creditAffiliation"	defaultValue="${affiliationValue }"
       className="text" type="select"/><span style="color: red;font-size: 12px;">月还归属必选项，请认真核对！默认归属我司！</span>
  </td>  
</tr>
</table>

<!-- 列表按钮操作 start -->
	<div id="creditDetailOperation" class="tableToolbar">
		  	<a href="javascript:void(0)" id="addCredit" onclick="toAddDataCredit()" title="分配债权">新 增</a>
		  	<a href="javascript:void(0)" id="deleteCredit" onclick="deleteCredit()" >删 除</a>
		  	<a href="javascript:void(0)" onclick="sureExport()" >导出</a>
		  	<a href="javascript:void(0)" onclick="importCreditDetail()" title="将转让的债权标记上交互状态(已卖出,取消)和结算标识(待结算,取消)">导入</a>
		  	<a href="javascript:void(0)" onclick="costParameterSum('costParameter')" >费用试算</a>
		  	<!-- <a href="javascript:void(0)" onclick="costParameterConfirm('part')" index="3">结算申请</a> -->
	</div>
	<div id="creditDetailTable">
		<%@include file="../creditManage/viewCreditDealDetail.jsp" %>

	</div>
 
<!-- <table class="formTableSwap" border="0" align="center" cellpadding="0" cellspacing="1">
<tr>
 	<td colspan="6" align="center" class="thTop">债权结算</td>	
</tr>

<tr>
  <th style="width:100px;"> 费用金额：</th>
  <td colspan="6" align="left"> 
  <input type="text" class="text" id="dtopracticalSellSum" name="practicalSellSum"  maxLength="11" value="" />
  </td>
 
</tr>
</table> -->

</form>
<div class="expandToolbar">
		<span class="submitBtn mouseName" id="saveDeal" onclick="saveCreditDeal()" title="分配完债权,请及时保存。">保存</span>
	<!--<span class="submitBtn mouseName" onclick="settleCreditDeal()">试算</span> -->
		<span class="submitBtn mouseName" id="finishDeal" onclick="finishDeal()" title="分配完成,通知理财机构。">完成</span>
		<span class="submitBtn mouseName" id="confirmDeal" onclick="confirmDeal()" title="审核确认本次债权转让">确认</span>
		<span class="submitBtn mouseName" onclick="closeFather()">关闭</span>
 
</div>
 <span style="font-size: 12px;color: red;">***导入excel信息必须与模板一致，交互状态(已卖出,取消),结算标识(待结算,取消)，每次导入数据建议为一千条数据。</span><br>
  <span style="font-size: 12px;color: red;">***结算申请请在导入确认债权价值以及费用等数据后操作.</span><br>
  <span style="font-size: 12px;color: red;">***导入excel确认债权时：转让编号，债权编号，本次转让债权价值，转让债权价值，交割日期，交互状态为必选字段，假如是铜板街,还需所属包编号和机构理财包号也不能为空！</span>
</div>

</body>

<script type="text/javascript">
   $(document).ready(function(){
   		checkedInit();
   		$("#creditorAffirmRule").prop("disabled",true);
   		
	});
	
	
	
</script>
  
</html>
